package com.yanqu.road.server.cmd.activity;

import com.yanqu.road.utils.YanQuMessageUtils;
import com.yanqu.road.pb.activity.StrongholdActivityProto;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.logic.MessageHelper;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.Protocol;

@Cmd(code = Protocol.C_CROSS_GENERAL_MEMBER_CONDITION_DATA, desc = "跨服查询跨服活动成员贡献信息")
public class CrossGeneralActivityMemberConditionDataCmd extends CrossCommand {


    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {

        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        StrongholdActivityProto.StrongholdWarActivityConditionUnionMemberDataReqMsg reqMsg = StrongholdActivityProto.StrongholdWarActivityConditionUnionMemberDataReqMsg.parseFrom(packet.getBytes());
        long reqUserId = packet.getPlayerId();
        StrongholdActivityProto.CrossStrongholdActivityConditionUnionMemberDataReqMsg.Builder msg = StrongholdActivityProto.CrossStrongholdActivityConditionUnionMemberDataReqMsg.newBuilder();
        msg.setUserId(reqUserId);
        msg.setServerId(serverId);
        msg.setActivityId(reqMsg.getActivityId());
        msg.setUnionUid(reqMsg.getUnionUid());
        msg.setConditionType(reqMsg.getType());
        YanQuMessage pbMsg = YanQuMessageUtils.buildMessage(Protocol.S_CROSS_GENERAL_ACTIVITY_QUERY_MEMBER_CONDITION, msg);
        MessageHelper.sendPacket(reqMsg.getServerId(), 0, pbMsg);
    }

    @Override
    public void sendData() {

    }

}
